package com.hb.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.util.concurrent.TimeUnit;

@SpringBootApplication
public class NacosConfigApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(NacosConfigApplication.class, args);
        //while (true){
        //    String username = applicationContext.getEnvironment().getProperty("user.name");
        //    System.out.println("username = " + username);
        //    String age = applicationContext.getEnvironment().getProperty("user.age");
        //    System.out.println("age = " + age);
        //    TimeUnit.SECONDS.sleep(2);
        //}
    }
}
